# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 164
n 164(None)[GenericListing._create_content(self, start, self.style_name[:-7])
]:
	i: 85(), 121(), 138()
	o: 

nname: 138
n 138(None)[start = max(0, len(ml) - nb_positions)
]:
	i: 95(f)
	o: 164()

nname: 121
n 121(None)[start = ml.selected_pos - midpos
]:
	i: 95(t)
	o: 164()

nname: 95
n 95(ml.selected_pos < len(ml) - midpos)[]:
	i: 18(f)
	o: 121(t), 138(f)

nname: 85
n 85(None)[start = 0
]:
	i: 18(t)
	o: 164()

nname: 18
n 18(ml.selected_pos <= midpos)[self._initialized = True
self._last_timestamp = 0
ml = self.menu_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
]:
	i: 9(), 17()
	o: 85(t), 95(f)

nname: 17
n 17(None)[]:
	i: 0(f)
	o: 18()

nname: 9
n 9(None)[]:
	i: 0(t)
	o: 18()

nname: 0
n 0(self._initialized)[]:
	i: 
	o: 9(t), 17(f)

nname: 164
n 164(None)[GenericListing._create_content(self, start, self.style_name[:-7])
]:
	i: 0()
	o: 

nname: 0
n 0(None)[if self._initialized:
	pass
self._initialized = True
self._last_timestamp = 0
ml = self.menu_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
if ml.selected_pos <= midpos:
	start = 0
else:
	if ml.selected_pos < len(ml) - midpos:
		start = ml.selected_pos - midpos
	else:
		start = max(0, len(ml) - nb_positions)
]:
	i: 
	o: 164()

nname: 0
n 0(None)[if self._initialized:
	pass
self._initialized = True
self._last_timestamp = 0
ml = self.menu_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
if ml.selected_pos <= midpos:
	start = 0
else:
	if ml.selected_pos < len(ml) - midpos:
		start = ml.selected_pos - midpos
	else:
		start = max(0, len(ml) - nb_positions)
GenericListing._create_content(self, start, self.style_name[:-7])
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb771066c>}
nname: 633
n 633(None)[return None
]:
	i: 606(), 632()
	o: 

nname: 632
n 632(None)[]:
	i: 597(f)
	o: 633()

nname: 606
n 606(None)[self._edited = False
self.do_edit(True)
]:
	i: 597(t)
	o: 633()

nname: 597
n 597(self._edited)[]:
	i: 517(JA), 579(), 596()
	o: 606(t), 632(f)

nname: 596
n 596(None)[]:
	i: 463(f)
	o: 597()

nname: 579
n 579(None)[self._bar.hide()
]:
	i: 488&501(f)
	o: 597()

nname: 517
n 517(None)[self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
self._bar.show()
]:
	i: 488&501(t)
	o: 597(JA)

nname: 488&501
n 488&501(len(ml) and il.selected >= 0)[]:
	i: 463(t)
	o: 517(t), 579(f)

nname: 463
n 463(self._bar is not None)[self._refresh_more_items()
]:
	i: 226(JA), 240(), 433()
	o: 488&501(t), 596(f)

nname: 433
n 433(None)[il.selected = ml.selected_pos
il.start = start
il.end = end
]:
	i: 280(AL), 432()
	o: 463()

nname: 432
n 432(None)[]:
	i: 284(AF), 403()
	o: 433()

nname: 403
n 403(None)[ui_item.widget.animate_stop()
pos.put(ui_item)
]:
	i: 352(), 366()
	o: 432()

nname: 366
n 366(None)[ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
]:
	i: 322(f)
	o: 403()

nname: 352
n 352(None)[ui_item.destroy()
]:
	i: 322(t)
	o: 403()

nname: 322
n 322(menu_item is None)[for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
]:
	i: 284(for)
	o: 352(t), 366(f)

nname: 284
n 284(None)[]:
	i: 280(loop)
	o: 322(for), 432(AF)

nname: 280
n 280(None)[]:
	i: 158(f)
	o: 284(loop), 433(AL)

nname: 240
n 240(None)[ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
]:
	i: 189(f)
	o: 463()

nname: 226
n 226(None)[ui_item.destroy()
]:
	i: 189(t)
	o: 463(JA)

nname: 189
n 189(menu_item is None)[menu_item = ml[position]
ui_item = il[position - start]
]:
	i: 158(t)
	o: 226(t), 240(f)

nname: 158
n 158(position is not None)[end = start + nb_positions
selected = ml.selected
]:
	i: 79(), 115(), 132()
	o: 189(t), 280(f)

nname: 132
n 132(None)[start = max(0, len(ml) - nb_positions)
]:
	i: 89(f)
	o: 158()

nname: 115
n 115(None)[start = ml.selected_pos - midpos
]:
	i: 89(t)
	o: 158()

nname: 89
n 89(ml.selected_pos < len(ml) - midpos)[]:
	i: 0(f)
	o: 115(t), 132(f)

nname: 79
n 79(None)[start = 0
]:
	i: 0(t)
	o: 158()

nname: 0
n 0(ml.selected_pos <= midpos)[ml = self.menu_list
il = self.item_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[ml.selected_pos:ml.selected_pos + nb_positions]
]:
	i: 
	o: 79(t), 89(f)

nname: 633
n 633(None)[return None
]:
	i: 463()
	o: 

nname: 463
n 463(None)[self._refresh_more_items()
if self._bar is not None:
	if len(ml) and il.selected >= 0:
		self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
		self._bar.show()
	else:
		self._bar.hide()
if self._edited:
	self._edited = False
	self.do_edit(True)
]:
	i: 189(JA), 433()
	o: 633()

nname: 433
n 433(None)[il.selected = ml.selected_pos
il.start = start
il.end = end
]:
	i: 280(AL), 284(AF), 322()
	o: 463()

nname: 322
n 322(None)[for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
if menu_item is None:
	ui_item.destroy()
else:
	ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
ui_item.widget.animate_stop()
pos.put(ui_item)
]:
	i: 284(for)
	o: 433()

nname: 284
n 284(None)[]:
	i: 280(loop)
	o: 322(for), 433(AF)

nname: 280
n 280(None)[]:
	i: 0(f)
	o: 284(loop), 433(AL)

nname: 189
n 189(None)[menu_item = ml[position]
ui_item = il[position - start]
if menu_item is None:
	ui_item.destroy()
else:
	ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
]:
	i: 0(t)
	o: 463(JA)

nname: 0
n 0(position is not None)[ml = self.menu_list
il = self.item_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[ml.selected_pos:ml.selected_pos + nb_positions]
if ml.selected_pos <= midpos:
	start = 0
else:
	if ml.selected_pos < len(ml) - midpos:
		start = ml.selected_pos - midpos
	else:
		start = max(0, len(ml) - nb_positions)
end = start + nb_positions
selected = ml.selected
]:
	i: 
	o: 189(t), 280(f)

nname: 463
n 463(None)[self._refresh_more_items()
if self._bar is not None:
	if len(ml) and il.selected >= 0:
		self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
		self._bar.show()
	else:
		self._bar.hide()
if self._edited:
	self._edited = False
	self.do_edit(True)
return None
]:
	i: 189(JA), 322()
	o: 

nname: 322
n 322(None)[for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
	if menu_item is None:
		ui_item.destroy()
	else:
		ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
	ui_item.widget.animate_stop()
	pos.put(ui_item)
il.selected = ml.selected_pos
il.start = start
il.end = end
]:
	i: 280(for)
	o: 463()

nname: 280
n 280(None)[]:
	i: 0(f)
	o: 322(for)

nname: 189
n 189(None)[menu_item = ml[position]
ui_item = il[position - start]
if menu_item is None:
	ui_item.destroy()
else:
	ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
]:
	i: 0(t)
	o: 463(JA)

nname: 0
n 0(position is not None)[ml = self.menu_list
il = self.item_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[ml.selected_pos:ml.selected_pos + nb_positions]
if ml.selected_pos <= midpos:
	start = 0
else:
	if ml.selected_pos < len(ml) - midpos:
		start = ml.selected_pos - midpos
	else:
		start = max(0, len(ml) - nb_positions)
end = start + nb_positions
selected = ml.selected
]:
	i: 
	o: 189(t), 280(f)

nname: 463
n 463(None)[self._refresh_more_items()
if self._bar is not None:
	if len(ml) and il.selected >= 0:
		self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
		self._bar.show()
	else:
		self._bar.hide()
if self._edited:
	self._edited = False
	self.do_edit(True)
return None
]:
	i: 189(JA), 280()
	o: 

nname: 280
n 280(None)[for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
	if menu_item is None:
		ui_item.destroy()
	else:
		ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
	ui_item.widget.animate_stop()
	pos.put(ui_item)
il.selected = ml.selected_pos
il.start = start
il.end = end
]:
	i: 0(f)
	o: 463()

nname: 189
n 189(None)[menu_item = ml[position]
ui_item = il[position - start]
if menu_item is None:
	ui_item.destroy()
else:
	ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
]:
	i: 0(t)
	o: 463(JA)

nname: 0
n 0(position is not None)[ml = self.menu_list
il = self.item_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[ml.selected_pos:ml.selected_pos + nb_positions]
if ml.selected_pos <= midpos:
	start = 0
else:
	if ml.selected_pos < len(ml) - midpos:
		start = ml.selected_pos - midpos
	else:
		start = max(0, len(ml) - nb_positions)
end = start + nb_positions
selected = ml.selected
]:
	i: 
	o: 189(t), 280(f)

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[ml.selected_pos:ml.selected_pos + nb_positions]
if ml.selected_pos <= midpos:
	start = 0
else:
	if ml.selected_pos < len(ml) - midpos:
		start = ml.selected_pos - midpos
	else:
		start = max(0, len(ml) - nb_positions)
end = start + nb_positions
selected = ml.selected
if position is not None:
	menu_item = ml[position]
	ui_item = il[position - start]
	if menu_item is None:
		ui_item.destroy()
	else:
		ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
else:
	for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
		if menu_item is None:
			ui_item.destroy()
		else:
			ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
		ui_item.widget.animate_stop()
		pos.put(ui_item)
	il.selected = ml.selected_pos
	il.start = start
	il.end = end
self._refresh_more_items()
if self._bar is not None:
	if len(ml) and il.selected >= 0:
		self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
		self._bar.show()
	else:
		self._bar.hide()
if self._edited:
	self._edited = False
	self.do_edit(True)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb7708eec>}
nname: 431
n 431(None)[return None
]:
	i: 381(JA), 426(), 430()
	o: 

nname: 430
n 430(None)[]:
	i: 353(f)
	o: 431()

nname: 426
n 426(None)[]:
	i: 365(f)
	o: 431()

nname: 381
n 381(None)[self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
]:
	i: 365(t)
	o: 431(JA)

nname: 365
n 365(self._bar is not None)[]:
	i: 353(t)
	o: 381(t), 426(f)

nname: 353
n 353(sel_item_idx != old_sel_idx)[]:
	i: 335(), 352()
	o: 365(t), 430(f)

nname: 352
n 352(None)[]:
	i: 250(f)
	o: 353()

nname: 335
n 335(None)[il[sel_item_idx].selected = True
]:
	i: 250(t)
	o: 353()

nname: 250
n 250(position == il_selected)[GenericListing._remove_item(self, position, scroll_up)
il.start = start
il.end = start + nb_positions
il.selected = ml_sel_pos
GenericListing._refresh_more_items(self)
sel_item_idx = ml_sel_pos - start
]:
	i: 124(), 203(), 209()
	o: 335(t), 352(f)

nname: 209
n 209(None)[start = max(0, len(ml) - nb_positions)
scroll_up = il.start == 0
]:
	i: 140(f)
	o: 250()

nname: 203
n 203(None)[scroll_up = ml_sel_pos == il_selected
]:
	i: 186(), 193()
	o: 250()

nname: 193
n 193(None)[]:
	i: 163(f)
	o: 203()

nname: 186
n 186(None)[]:
	i: 163(t)
	o: 203()

nname: 163
n 163(il_selected < position)[start = ml_sel_pos - midpos
]:
	i: 140(t)
	o: 186(t), 193(f)

nname: 140
n 140(ml_sel_pos < len(ml) - midpos)[]:
	i: 59(f)
	o: 163(t), 209(f)

nname: 124
n 124(None)[start = 0
scroll_up = True
]:
	i: 59(t)
	o: 250()

nname: 59
n 59(ml_sel_pos <= midpos)[il_selected = il.selected
old_sel_idx = il_selected - il.start
ml_sel_pos = ml.selected_pos
nb_positions = len(il)
midpos = nb_positions >> 1
]:
	i: 21(), 50(), 57(AE)
	o: 124(t), 140(f)

nname: 57
n 57(None)[]:
	i: 40(f)
	o: 59(AE)

nname: 50
n 50(None)[]:
	i: 40(t)
	o: 59()

nname: 40
n 40(<dummy_ex3> EXC_MATCH IndexError)[]:
	i: 0(except)
	o: 50(t), 57(f)

nname: 21
n 21(None)[ml[il.end - 2]
]:
	i: 0(try)
	o: 59()

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
]:
	i: 
	o: 21(try), 40(except)

nname: 431
n 431(None)[return None
]:
	i: 250(JA)
	o: 

nname: 250
n 250(None)[GenericListing._remove_item(self, position, scroll_up)
il.start = start
il.end = start + nb_positions
il.selected = ml_sel_pos
GenericListing._refresh_more_items(self)
sel_item_idx = ml_sel_pos - start
if position == il_selected:
	il[sel_item_idx].selected = True
if sel_item_idx != old_sel_idx:
	if self._bar is not None:
		self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
]:
	i: 124(), 163(), 209()
	o: 431(JA)

nname: 209
n 209(None)[start = max(0, len(ml) - nb_positions)
scroll_up = il.start == 0
]:
	i: 140(f)
	o: 250()

nname: 163
n 163(None)[start = ml_sel_pos - midpos
if il_selected < position:
	pass
scroll_up = ml_sel_pos == il_selected
]:
	i: 140(t)
	o: 250()

nname: 140
n 140(ml_sel_pos < len(ml) - midpos)[]:
	i: 40(f)
	o: 163(t), 209(f)

nname: 124
n 124(None)[start = 0
scroll_up = True
]:
	i: 40(t)
	o: 250()

nname: 40
n 40(ml_sel_pos <= midpos)[except IndexError:
	pass
il_selected = il.selected
old_sel_idx = il_selected - il.start
ml_sel_pos = ml.selected_pos
nb_positions = len(il)
midpos = nb_positions >> 1
]:
	i: 0()
	o: 124(t), 140(f)

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
try:
	ml[il.end - 2]
]:
	i: 
	o: 40()

nname: 250
n 250(None)[GenericListing._remove_item(self, position, scroll_up)
il.start = start
il.end = start + nb_positions
il.selected = ml_sel_pos
GenericListing._refresh_more_items(self)
sel_item_idx = ml_sel_pos - start
if position == il_selected:
	il[sel_item_idx].selected = True
if sel_item_idx != old_sel_idx:
	if self._bar is not None:
		self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
try:
	ml[il.end - 2]
except IndexError:
	pass
il_selected = il.selected
old_sel_idx = il_selected - il.start
ml_sel_pos = ml.selected_pos
nb_positions = len(il)
midpos = nb_positions >> 1
if ml_sel_pos <= midpos:
	start = 0
	scroll_up = True
else:
	if ml_sel_pos < len(ml) - midpos:
		start = ml_sel_pos - midpos
		if il_selected < position:
			pass
		scroll_up = ml_sel_pos == il_selected
	else:
		start = max(0, len(ml) - nb_positions)
		scroll_up = il.start == 0
]:
	i: 
	o: 250()

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
try:
	ml[il.end - 2]
except IndexError:
	pass
il_selected = il.selected
old_sel_idx = il_selected - il.start
ml_sel_pos = ml.selected_pos
nb_positions = len(il)
midpos = nb_positions >> 1
if ml_sel_pos <= midpos:
	start = 0
	scroll_up = True
else:
	if ml_sel_pos < len(ml) - midpos:
		start = ml_sel_pos - midpos
		if il_selected < position:
			pass
		scroll_up = ml_sel_pos == il_selected
	else:
		start = max(0, len(ml) - nb_positions)
		scroll_up = il.start == 0
GenericListing._remove_item(self, position, scroll_up)
il.start = start
il.end = start + nb_positions
il.selected = ml_sel_pos
GenericListing._refresh_more_items(self)
sel_item_idx = ml_sel_pos - start
if position == il_selected:
	il[sel_item_idx].selected = True
if sel_item_idx != old_sel_idx:
	if self._bar is not None:
		self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb770872c>}
nname: 528
n 528(None)[return None
]:
	i: 419(JA), 478(), 527()
	o: 

nname: 527
n 527(None)[]:
	i: 220(f)
	o: 528()

nname: 478
n 478(None)[self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=self.duration)
]:
	i: 412(f)
	o: 528()

nname: 419
n 419(None)[self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=0)
self._bar.show()
]:
	i: 412(t)
	o: 528(JA)

nname: 412
n 412(il_get_focused)[]:
	i: 220(t)
	o: 419(t), 478(f)

nname: 220
n 220(self._bar is not None)[ts = sched.ts
duration = max(0.001, min(self.duration, ts - self._last_timestamp - 0.12))
self._last_timestamp = ts
il[il.selected - il.start].selected = False
GenericListing._scroll(self, start - il.start, duration, None)
il[position - start].selected = True
il_get_focused = il.selected == -1
il.selected = position
il.start = start
il.end = end
self._refresh_more_items()
]:
	i: 202(), 219()
	o: 412(t), 527(f)

nname: 219
n 219(None)[]:
	i: 183(f)
	o: 220()

nname: 202
n 202(None)[log.error('Changing selection while editing')
]:
	i: 183(t)
	o: 220()

nname: 183
n 183(self._edited)[end = start + nb_positions
]:
	i: 110(), 143(), 157()
	o: 202(t), 219(f)

nname: 157
n 157(None)[start = max(0, len(ml) - nb_positions)
]:
	i: 120(f)
	o: 183()

nname: 143
n 143(None)[start = position - midpos
]:
	i: 120(t)
	o: 183()

nname: 120
n 120(position < len(ml) - midpos)[]:
	i: 58(f)
	o: 143(t), 157(f)

nname: 110
n 110(None)[start = 0
]:
	i: 58(t)
	o: 183()

nname: 58
n 58(position <= midpos)[nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[position:position + midpos]
]:
	i: 49(), 57()
	o: 110(t), 120(f)

nname: 57
n 57(None)[]:
	i: 0&33(f)
	o: 58()

nname: 49
n 49(None)[return True
]:
	i: 0&33(t)
	o: 58()

nname: 0&33
n 0&33(ml.selected is None or il.selected == position)[il = self.item_list
ml = self.menu_list
]:
	i: 
	o: 49(t), 57(f)

nname: 220
n 220(None)[ts = sched.ts
duration = max(0.001, min(self.duration, ts - self._last_timestamp - 0.12))
self._last_timestamp = ts
il[il.selected - il.start].selected = False
GenericListing._scroll(self, start - il.start, duration, None)
il[position - start].selected = True
il_get_focused = il.selected == -1
il.selected = position
il.start = start
il.end = end
self._refresh_more_items()
if self._bar is not None:
	if il_get_focused:
		self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=0)
		self._bar.show()
	else:
		self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=self.duration)
return None
]:
	i: 0&33()
	o: 

nname: 0&33
n 0&33(None)[il = self.item_list
ml = self.menu_list
if ml.selected is None or il.selected == position:
	return True
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[position:position + midpos]
if position <= midpos:
	start = 0
else:
	if position < len(ml) - midpos:
		start = position - midpos
	else:
		start = max(0, len(ml) - nb_positions)
end = start + nb_positions
if self._edited:
	log.error('Changing selection while editing')
]:
	i: 
	o: 220()

nname: 0&33
n 0&33(None)[il = self.item_list
ml = self.menu_list
if ml.selected is None or il.selected == position:
	return True
nb_positions = len(self.positions_list)
midpos = nb_positions >> 1
ml[position:position + midpos]
if position <= midpos:
	start = 0
else:
	if position < len(ml) - midpos:
		start = position - midpos
	else:
		start = max(0, len(ml) - nb_positions)
end = start + nb_positions
if self._edited:
	log.error('Changing selection while editing')
ts = sched.ts
duration = max(0.001, min(self.duration, ts - self._last_timestamp - 0.12))
self._last_timestamp = ts
il[il.selected - il.start].selected = False
GenericListing._scroll(self, start - il.start, duration, None)
il[position - start].selected = True
il_get_focused = il.selected == -1
il.selected = position
il.start = start
il.end = end
self._refresh_more_items()
if self._bar is not None:
	if il_get_focused:
		self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=0)
		self._bar.show()
	else:
		self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=self.duration)
return None
]:
	i: 
	o: 

self.nodes: {'0&33': <unpyclib.structure.node instance at 0xb770866c>}
nname: 245
n 245(None)[return None
]:
	i: 172(JA), 224(), 228()
	o: 

nname: 228
n 228(None)[GenericListing.do_add(self, position)
]:
	i: 0&63(f)
	o: 245()

nname: 224
n 224(None)[]:
	i: 88(f)
	o: 245()

nname: 172
n 172(None)[self._bar.animate('move', vcenter=self.positions_list[il.selected - il.start]._y, duration=0)
]:
	i: 88(t)
	o: 245(JA)

nname: 88
n 88(self._bar is not None)[GenericListing._scroll(self, 1, self.duration, None)
il.start += 1
il.end += 1
GenericListing._refresh_more_items(self)
]:
	i: 0&63(t)
	o: 172(t), 224(f)

nname: 0&63
n 0&63(il.selected >= len(ml) - 1 - midpos and len(il) < len(ml))[il = self.item_list
ml = self.menu_list
midpos = len(il) >> 1
]:
	i: 
	o: 88(t), 228(f)

nname: 0&63
n 0&63(None)[il = self.item_list
ml = self.menu_list
midpos = len(il) >> 1
if il.selected >= len(ml) - 1 - midpos and len(il) < len(ml):
	GenericListing._scroll(self, 1, self.duration, None)
	il.start += 1
	il.end += 1
	GenericListing._refresh_more_items(self)
	if self._bar is not None:
		self._bar.animate('move', vcenter=self.positions_list[il.selected - il.start]._y, duration=0)
else:
	GenericListing.do_add(self, position)
return None
]:
	i: 
	o: 

self.nodes: {'0&63': <unpyclib.structure.node instance at 0xb7708eec>}
nname: 313
n 313(None)[return None
]:
	i: 266(), 312()
	o: 

nname: 312
n 312(None)[]:
	i: 185(f)
	o: 313()

nname: 266
n 266(None)[self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
]:
	i: 185(t)
	o: 313()

nname: 185
n 185(self._bar is not None)[GenericListing._scroll(self, start - il.start, self.duration, ml.selected)
il.selected = sel_index
il.start = start
il.end = start + nb_positions
]:
	i: 170(), 184()
	o: 266(t), 312(f)

nname: 184
n 184(None)[]:
	i: 149(t)
	o: 185()

nname: 170
n 170(None)[return self.do_reset()
]:
	i: 149(f)
	o: 185()

nname: 149
n 149(GenericListing._swap_items(self, i1, i2))[]:
	i: 76(), 109(), 123()
	o: 170(f), 184(t)

nname: 123
n 123(None)[start = max(0, len(ml) - nb_positions)
]:
	i: 86(f)
	o: 149()

nname: 109
n 109(None)[start = sel_index - midpos
]:
	i: 86(t)
	o: 149()

nname: 86
n 86(sel_index < len(ml) - midpos)[]:
	i: 0(f)
	o: 109(t), 123(f)

nname: 76
n 76(None)[start = 0
]:
	i: 0(t)
	o: 149()

nname: 0
n 0(sel_index < midpos)[ml = self.menu_list
il = self.item_list
nb_positions = len(il)
sel_index = ml.selected_pos
ml[sel_index:sel_index + nb_positions]
midpos = nb_positions >> 1
]:
	i: 
	o: 76(t), 86(f)

nname: 185
n 185(None)[GenericListing._scroll(self, start - il.start, self.duration, ml.selected)
il.selected = sel_index
il.start = start
il.end = start + nb_positions
if self._bar is not None:
	self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
return None
]:
	i: 0()
	o: 

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
nb_positions = len(il)
sel_index = ml.selected_pos
ml[sel_index:sel_index + nb_positions]
midpos = nb_positions >> 1
if sel_index < midpos:
	start = 0
else:
	if sel_index < len(ml) - midpos:
		start = sel_index - midpos
	else:
		start = max(0, len(ml) - nb_positions)
if not GenericListing._swap_items(self, i1, i2):
	return self.do_reset()
]:
	i: 
	o: 185()

nname: 0
n 0(None)[ml = self.menu_list
il = self.item_list
nb_positions = len(il)
sel_index = ml.selected_pos
ml[sel_index:sel_index + nb_positions]
midpos = nb_positions >> 1
if sel_index < midpos:
	start = 0
else:
	if sel_index < len(ml) - midpos:
		start = sel_index - midpos
	else:
		start = max(0, len(ml) - nb_positions)
if not GenericListing._swap_items(self, i1, i2):
	return self.do_reset()
GenericListing._scroll(self, start - il.start, self.duration, ml.selected)
il.selected = sel_index
il.start = start
il.end = start + nb_positions
if self._bar is not None:
	self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb77107cc>}
nname: 6
n 6(None)[__doc__ = " List where selected item is kept is the middle of the list as far as it's\n       possible.\n    "
def create_content(self):
	if self._initialized:
		pass
	self._initialized = True
	self._last_timestamp = 0
	ml = self.menu_list
	nb_positions = len(self.positions_list)
	midpos = nb_positions >> 1
	if ml.selected_pos <= midpos:
		start = 0
	else:
		if ml.selected_pos < len(ml) - midpos:
			start = ml.selected_pos - midpos
		else:
			start = max(0, len(ml) - nb_positions)
	GenericListing._create_content(self, start, self.style_name[:-7])

def do_reset(self, position=None, focus=None):
	ml = self.menu_list
	il = self.item_list
	nb_positions = len(self.positions_list)
	midpos = nb_positions >> 1
	ml[ml.selected_pos:ml.selected_pos + nb_positions]
	if ml.selected_pos <= midpos:
		start = 0
	else:
		if ml.selected_pos < len(ml) - midpos:
			start = ml.selected_pos - midpos
		else:
			start = max(0, len(ml) - nb_positions)
	end = start + nb_positions
	selected = ml.selected
	if position is not None:
		menu_item = ml[position]
		ui_item = il[position - start]
		if menu_item is None:
			ui_item.destroy()
		else:
			ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
	else:
		for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
			if menu_item is None:
				ui_item.destroy()
			else:
				ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
			ui_item.widget.animate_stop()
			pos.put(ui_item)
		il.selected = ml.selected_pos
		il.start = start
		il.end = end
	self._refresh_more_items()
	if self._bar is not None:
		if len(ml) and il.selected >= 0:
			self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
			self._bar.show()
		else:
			self._bar.hide()
	if self._edited:
		self._edited = False
		self.do_edit(True)
	return None

def do_remove(self, position):
	ml = self.menu_list
	il = self.item_list
	try:
		ml[il.end - 2]
	except IndexError:
		pass
	il_selected = il.selected
	old_sel_idx = il_selected - il.start
	ml_sel_pos = ml.selected_pos
	nb_positions = len(il)
	midpos = nb_positions >> 1
	if ml_sel_pos <= midpos:
		start = 0
		scroll_up = True
	else:
		if ml_sel_pos < len(ml) - midpos:
			start = ml_sel_pos - midpos
			if il_selected < position:
				pass
			scroll_up = ml_sel_pos == il_selected
		else:
			start = max(0, len(ml) - nb_positions)
			scroll_up = il.start == 0
	GenericListing._remove_item(self, position, scroll_up)
	il.start = start
	il.end = start + nb_positions
	il.selected = ml_sel_pos
	GenericListing._refresh_more_items(self)
	sel_item_idx = ml_sel_pos - start
	if position == il_selected:
		il[sel_item_idx].selected = True
	if sel_item_idx != old_sel_idx:
		if self._bar is not None:
			self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
	return None

def do_update(self, position):
	il = self.item_list
	ml = self.menu_list
	if ml.selected is None or il.selected == position:
		return True
	nb_positions = len(self.positions_list)
	midpos = nb_positions >> 1
	ml[position:position + midpos]
	if position <= midpos:
		start = 0
	else:
		if position < len(ml) - midpos:
			start = position - midpos
		else:
			start = max(0, len(ml) - nb_positions)
	end = start + nb_positions
	if self._edited:
		log.error('Changing selection while editing')
	ts = sched.ts
	duration = max(0.001, min(self.duration, ts - self._last_timestamp - 0.12))
	self._last_timestamp = ts
	il[il.selected - il.start].selected = False
	GenericListing._scroll(self, start - il.start, duration, None)
	il[position - start].selected = True
	il_get_focused = il.selected == -1
	il.selected = position
	il.start = start
	il.end = end
	self._refresh_more_items()
	if self._bar is not None:
		if il_get_focused:
			self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=0)
			self._bar.show()
		else:
			self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=self.duration)
	return None

def do_add(self, position):
	il = self.item_list
	ml = self.menu_list
	midpos = len(il) >> 1
	if il.selected >= len(ml) - 1 - midpos and len(il) < len(ml):
		GenericListing._scroll(self, 1, self.duration, None)
		il.start += 1
		il.end += 1
		GenericListing._refresh_more_items(self)
		if self._bar is not None:
			self._bar.animate('move', vcenter=self.positions_list[il.selected - il.start]._y, duration=0)
	else:
		GenericListing.do_add(self, position)
	return None

def do_swap(self, i1, i2):
	ml = self.menu_list
	il = self.item_list
	nb_positions = len(il)
	sel_index = ml.selected_pos
	ml[sel_index:sel_index + nb_positions]
	midpos = nb_positions >> 1
	if sel_index < midpos:
		start = 0
	else:
		if sel_index < len(ml) - midpos:
			start = sel_index - midpos
		else:
			start = max(0, len(ml) - nb_positions)
	if not GenericListing._swap_items(self, i1, i2):
		return self.do_reset()
	GenericListing._scroll(self, start - il.start, self.duration, ml.selected)
	il.selected = sel_index
	il.start = start
	il.end = start + nb_positions
	if self._bar is not None:
		self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
	return None

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb7702c0c>}
nname: 0
n 0(None)[from __future__ import absolute_import, with_statement
__all__ = ['HybridListing']
from .core import GenericListing
from peewee.debug import GET_LOGGER
from peewee.notifier import sched
from wyvas import render_lock
log = GET_LOGGER(__name__)
class HybridListing(GenericListing):
	__doc__ = " List where selected item is kept is the middle of the list as far as it's\n       possible.\n    "
	def create_content(self):
		if self._initialized:
			pass
		self._initialized = True
		self._last_timestamp = 0
		ml = self.menu_list
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		if ml.selected_pos <= midpos:
			start = 0
		else:
			if ml.selected_pos < len(ml) - midpos:
				start = ml.selected_pos - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		GenericListing._create_content(self, start, self.style_name[:-7])

	def do_reset(self, position=None, focus=None):
		ml = self.menu_list
		il = self.item_list
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		ml[ml.selected_pos:ml.selected_pos + nb_positions]
		if ml.selected_pos <= midpos:
			start = 0
		else:
			if ml.selected_pos < len(ml) - midpos:
				start = ml.selected_pos - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		end = start + nb_positions
		selected = ml.selected
		if position is not None:
			menu_item = ml[position]
			ui_item = il[position - start]
			if menu_item is None:
				ui_item.destroy()
			else:
				ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
		else:
			for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
				if menu_item is None:
					ui_item.destroy()
				else:
					ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
				ui_item.widget.animate_stop()
				pos.put(ui_item)
			il.selected = ml.selected_pos
			il.start = start
			il.end = end
		self._refresh_more_items()
		if self._bar is not None:
			if len(ml) and il.selected >= 0:
				self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
				self._bar.show()
			else:
				self._bar.hide()
		if self._edited:
			self._edited = False
			self.do_edit(True)
		return None

	def do_remove(self, position):
		ml = self.menu_list
		il = self.item_list
		try:
			ml[il.end - 2]
		except IndexError:
			pass
		il_selected = il.selected
		old_sel_idx = il_selected - il.start
		ml_sel_pos = ml.selected_pos
		nb_positions = len(il)
		midpos = nb_positions >> 1
		if ml_sel_pos <= midpos:
			start = 0
			scroll_up = True
		else:
			if ml_sel_pos < len(ml) - midpos:
				start = ml_sel_pos - midpos
				if il_selected < position:
					pass
				scroll_up = ml_sel_pos == il_selected
			else:
				start = max(0, len(ml) - nb_positions)
				scroll_up = il.start == 0
		GenericListing._remove_item(self, position, scroll_up)
		il.start = start
		il.end = start + nb_positions
		il.selected = ml_sel_pos
		GenericListing._refresh_more_items(self)
		sel_item_idx = ml_sel_pos - start
		if position == il_selected:
			il[sel_item_idx].selected = True
		if sel_item_idx != old_sel_idx:
			if self._bar is not None:
				self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
		return None

	def do_update(self, position):
		il = self.item_list
		ml = self.menu_list
		if ml.selected is None or il.selected == position:
			return True
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		ml[position:position + midpos]
		if position <= midpos:
			start = 0
		else:
			if position < len(ml) - midpos:
				start = position - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		end = start + nb_positions
		if self._edited:
			log.error('Changing selection while editing')
		ts = sched.ts
		duration = max(0.001, min(self.duration, ts - self._last_timestamp - 0.12))
		self._last_timestamp = ts
		il[il.selected - il.start].selected = False
		GenericListing._scroll(self, start - il.start, duration, None)
		il[position - start].selected = True
		il_get_focused = il.selected == -1
		il.selected = position
		il.start = start
		il.end = end
		self._refresh_more_items()
		if self._bar is not None:
			if il_get_focused:
				self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=0)
				self._bar.show()
			else:
				self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=self.duration)
		return None

	def do_add(self, position):
		il = self.item_list
		ml = self.menu_list
		midpos = len(il) >> 1
		if il.selected >= len(ml) - 1 - midpos and len(il) < len(ml):
			GenericListing._scroll(self, 1, self.duration, None)
			il.start += 1
			il.end += 1
			GenericListing._refresh_more_items(self)
			if self._bar is not None:
				self._bar.animate('move', vcenter=self.positions_list[il.selected - il.start]._y, duration=0)
		else:
			GenericListing.do_add(self, position)
		return None

	def do_swap(self, i1, i2):
		ml = self.menu_list
		il = self.item_list
		nb_positions = len(il)
		sel_index = ml.selected_pos
		ml[sel_index:sel_index + nb_positions]
		midpos = nb_positions >> 1
		if sel_index < midpos:
			start = 0
		else:
			if sel_index < len(ml) - midpos:
				start = sel_index - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		if not GenericListing._swap_items(self, i1, i2):
			return self.do_reset()
		GenericListing._scroll(self, start - il.start, self.duration, ml.selected)
		il.selected = sel_index
		il.start = start
		il.end = start + nb_positions
		if self._bar is not None:
			self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
		return None



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb76fcbac>}
from __future__ import absolute_import, with_statement
__all__ = ['HybridListing']
from .core import GenericListing
from peewee.debug import GET_LOGGER
from peewee.notifier import sched
from wyvas import render_lock
log = GET_LOGGER(__name__)
class HybridListing(GenericListing):
	__doc__ = " List where selected item is kept is the middle of the list as far as it's\n       possible.\n    "
	def create_content(self):
		if self._initialized:
			pass
		self._initialized = True
		self._last_timestamp = 0
		ml = self.menu_list
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		if ml.selected_pos <= midpos:
			start = 0
		else:
			if ml.selected_pos < len(ml) - midpos:
				start = ml.selected_pos - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		GenericListing._create_content(self, start, self.style_name[:-7])

	def do_reset(self, position=None, focus=None):
		ml = self.menu_list
		il = self.item_list
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		ml[ml.selected_pos:ml.selected_pos + nb_positions]
		if ml.selected_pos <= midpos:
			start = 0
		else:
			if ml.selected_pos < len(ml) - midpos:
				start = ml.selected_pos - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		end = start + nb_positions
		selected = ml.selected
		if position is not None:
			menu_item = ml[position]
			ui_item = il[position - start]
			if menu_item is None:
				ui_item.destroy()
			else:
				ui_item.reset(menu_item, menu_item is selected, position=position - start + 1)
		else:
			for i, pos in enumerate(map(None, self.positions_list, il, ml[start:end])):
				if menu_item is None:
					ui_item.destroy()
				else:
					ui_item.reset(menu_item, menu_item is selected, position=start + i + 1)
				ui_item.widget.animate_stop()
				pos.put(ui_item)
			il.selected = ml.selected_pos
			il.start = start
			il.end = end
		self._refresh_more_items()
		if self._bar is not None:
			if len(ml) and il.selected >= 0:
				self._bar.animate('move', vcenter=self.positions_list[il.selected - start]._y, duration=0)
				self._bar.show()
			else:
				self._bar.hide()
		if self._edited:
			self._edited = False
			self.do_edit(True)
		return None

	def do_remove(self, position):
		ml = self.menu_list
		il = self.item_list
		try:
			ml[il.end - 2]
		except IndexError:
			pass
		il_selected = il.selected
		old_sel_idx = il_selected - il.start
		ml_sel_pos = ml.selected_pos
		nb_positions = len(il)
		midpos = nb_positions >> 1
		if ml_sel_pos <= midpos:
			start = 0
			scroll_up = True
		else:
			if ml_sel_pos < len(ml) - midpos:
				start = ml_sel_pos - midpos
				if il_selected < position:
					pass
				scroll_up = ml_sel_pos == il_selected
			else:
				start = max(0, len(ml) - nb_positions)
				scroll_up = il.start == 0
		GenericListing._remove_item(self, position, scroll_up)
		il.start = start
		il.end = start + nb_positions
		il.selected = ml_sel_pos
		GenericListing._refresh_more_items(self)
		sel_item_idx = ml_sel_pos - start
		if position == il_selected:
			il[sel_item_idx].selected = True
		if sel_item_idx != old_sel_idx:
			if self._bar is not None:
				self._bar.animate('move', vcenter=self.positions_list[sel_item_idx]._y, duration=self.duration)
		return None

	def do_update(self, position):
		il = self.item_list
		ml = self.menu_list
		if ml.selected is None or il.selected == position:
			return True
		nb_positions = len(self.positions_list)
		midpos = nb_positions >> 1
		ml[position:position + midpos]
		if position <= midpos:
			start = 0
		else:
			if position < len(ml) - midpos:
				start = position - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		end = start + nb_positions
		if self._edited:
			log.error('Changing selection while editing')
		ts = sched.ts
		duration = max(0.001, min(self.duration, ts - self._last_timestamp - 0.12))
		self._last_timestamp = ts
		il[il.selected - il.start].selected = False
		GenericListing._scroll(self, start - il.start, duration, None)
		il[position - start].selected = True
		il_get_focused = il.selected == -1
		il.selected = position
		il.start = start
		il.end = end
		self._refresh_more_items()
		if self._bar is not None:
			if il_get_focused:
				self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=0)
				self._bar.show()
			else:
				self._bar.animate('move', vcenter=self.positions_list[position - start]._y, duration=self.duration)
		return None

	def do_add(self, position):
		il = self.item_list
		ml = self.menu_list
		midpos = len(il) >> 1
		if il.selected >= len(ml) - 1 - midpos and len(il) < len(ml):
			GenericListing._scroll(self, 1, self.duration, None)
			il.start += 1
			il.end += 1
			GenericListing._refresh_more_items(self)
			if self._bar is not None:
				self._bar.animate('move', vcenter=self.positions_list[il.selected - il.start]._y, duration=0)
		else:
			GenericListing.do_add(self, position)
		return None

	def do_swap(self, i1, i2):
		ml = self.menu_list
		il = self.item_list
		nb_positions = len(il)
		sel_index = ml.selected_pos
		ml[sel_index:sel_index + nb_positions]
		midpos = nb_positions >> 1
		if sel_index < midpos:
			start = 0
		else:
			if sel_index < len(ml) - midpos:
				start = sel_index - midpos
			else:
				start = max(0, len(ml) - nb_positions)
		if not GenericListing._swap_items(self, i1, i2):
			return self.do_reset()
		GenericListing._scroll(self, start - il.start, self.duration, ml.selected)
		il.selected = sel_index
		il.start = start
		il.end = start + nb_positions
		if self._bar is not None:
			self._bar.animate('move', vcenter=self.positions_list[sel_index - start]._y, duration=0)
		return None



